package com.prd.controller;

import com.prd.model.EntNarrationInterview;
import com.prd.service.EntNarrationInterviewService;
import com.prd.util.AjaxResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@Api(tags = {"述职面谈"})
@RestController
@RequestMapping("/api/entNarrationInterview")
public class EntNarrationInterviewController extends BaseController {

    @Autowired
    private EntNarrationInterviewService entNarrationInterviewService;

    @ApiOperation("添加信息")
    @PostMapping("add")
    public AjaxResult add(@RequestBody EntNarrationInterview entNarrationInterview) {
        return toAjax(entNarrationInterviewService.insertInterview(entNarrationInterview));
    }

    @ApiOperation("修改信息")
    @PostMapping("update")
    public AjaxResult update(@RequestBody EntNarrationInterview entNarrationInterview) {
        return toAjax(entNarrationInterviewService.updateInfo(entNarrationInterview));
    }

    @ApiOperation("删除信息")
    @PostMapping("remove/{id}")
    public AjaxResult remove(@PathVariable("id") Long id) {
        return toAjax(entNarrationInterviewService.removeById(id));
    }
}
